package com.facebook.imagepipeline.producers;

import com.facebook.imagepipeline.image.EncodedImage;
import com.facebook.imagepipeline.request.ImageRequest;

public class BranchOnSeparateImagesProducer
  implements Producer<EncodedImage>
{
  private final Producer<EncodedImage> mInputProducer1;
  private final Producer<EncodedImage> mInputProducer2;

  public BranchOnSeparateImagesProducer(Producer<EncodedImage> paramProducer1, Producer<EncodedImage> paramProducer2)
  {
    this.mInputProducer1 = paramProducer1;
    this.mInputProducer2 = paramProducer2;
  }

  public void produceResults(Consumer<EncodedImage> paramConsumer, ProducerContext paramProducerContext)
  {
    OnFirstImageConsumer localOnFirstImageConsumer = new OnFirstImageConsumer(paramConsumer, paramProducerContext, null);
    this.mInputProducer1.produceResults(localOnFirstImageConsumer, paramProducerContext);
  }

  private class OnFirstImageConsumer extends DelegatingConsumer<EncodedImage, EncodedImage>
  {
    private ProducerContext mProducerContext;

    private OnFirstImageConsumer(ProducerContext arg2)
    {
      super();
      Object localObject;
      this.mProducerContext = localObject;
    }

    protected void onFailureImpl(Throwable paramThrowable)
    {
      BranchOnSeparateImagesProducer.this.mInputProducer2.produceResults(getConsumer(), this.mProducerContext);
    }

    protected void onNewResultImpl(EncodedImage paramEncodedImage, boolean paramBoolean)
    {
      ImageRequest localImageRequest = this.mProducerContext.getImageRequest();
      boolean bool1 = ThumbnailSizeChecker.isImageBigEnough(paramEncodedImage, localImageRequest.getResizeOptions());
      Consumer localConsumer;
      if ((paramEncodedImage != null) && ((bool1) || (localImageRequest.getLocalThumbnailPreviewsEnabled())))
      {
        localConsumer = getConsumer();
        if ((!paramBoolean) || (!bool1))
          break label98;
      }
      label98: for (boolean bool2 = true; ; bool2 = false)
      {
        localConsumer.onNewResult(paramEncodedImage, bool2);
        if ((paramBoolean) && (!bool1))
        {
          EncodedImage.closeSafely(paramEncodedImage);
          BranchOnSeparateImagesProducer.this.mInputProducer2.produceResults(getConsumer(), this.mProducerContext);
        }
        return;
      }
    }
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.facebook.imagepipeline.producers.BranchOnSeparateImagesProducer
 * JD-Core Version:    0.6.2
 */